﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>私教详细</title>
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
    <link href="https://cdn.bootcss.com/amazeui/2.7.2/css/amazeui.css" rel="stylesheet" />
    <link href="http://s.amazeui.org/assets/2.x/css/amaze.min.css?v=ivneioml" rel="stylesheet" />
    <link href="css/common.css" rel="stylesheet" />
    <style>
        body {
            font-family: 微软雅黑;
            background: #f4f5f9;
        }

        .head {
            width: 100%;
            overflow: hidden;
            position: fixed;
            height: 40.5%;
        }

        .bg {
            background-repeat: no-repeat;
            background-position: center;
            background-size: cover;
            position: relative;
            max-height: 20rem;
            height: 75%;
        }

        .info {
            display: block;
            margin-bottom: 1%;
            position: absolute;
            left: 5%;
            bottom: 5%;
            color: #fff;
        }

        .name-info {
            background: #fff;
            padding: 1% 5%;
            width: 100%;
            height: 25%;
        }

        .name-info-main {
            color: #000;
            font-size: 1.6rem;
            margin-bottom: 1%;
            display: block;
        }

        .game_maind1 {
            background: #fff;
            display: flex;
            justify-content: space-between;
        }

        .am-tabs {
            background: #fff;
        }

        .am-nav-tabs {
            border: 1px solid #efefef;
            background: #fff;
        }

            .am-nav-tabs > li.am-active > a, .am-nav-tabs > li.am-active > a:hover, .am-nav-tabs > li.am-active > a:focus {
                border: none;
                border-bottom: 1px solid #6fddb1;
            }

            .am-nav-tabs > li > a {
                padding: 10% 0;
            }

        .am-tabs-bd {
            border: none;
        }

        .courseplaninfo {
            width: 100%;
            padding: 0 1%;
            height: 88%;
            overflow-y: auto;
            /*background: #fff;*/
        }

        .courseplanbody {
            padding: 3% 2%;
            width: 100%;
            background: #fff;
            border-radius: 10px;
            margin-top: 3%;
            display: flex;
            align-items: center;
            justify-content: space-between;
            height: 25%;
        }

        .coursedateimg {
            overflow: hidden;
        }

            .coursedateimg span {
                display: flex;
                width: 35px;
                height: 35px;
                background: #c7c7c7;
                justify-content: center;
                align-items: center;
                border-radius: 50%;
                color: #fff;
                font-size: 2.2rem;
            }

        .coursedateinfo {
            color: #c8c7c7;
            font-size: 1.4rem;
            margin-left: -15%;
        }

        .coursedateinfo_sp1 {
            display: block;
            font-size: 1.5rem;
        }

        .coursedateinfo_sp2 {
            display: block;
        }

        .fixed {
            position: fixed;
            bottom: 0;
            width: 100%;
            height: 12%;
            background: #fff;
            left: 0;
            border-top: 1px solid #efefef;
        }

        .active_btn {
            width: 25%;
            background: #54dea7;
            color: #fff;
            text-align: center;
            float: left;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .price {
            width: 50%;
            height: 100%;
            float: left;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #5e5e5e;
            font-size: 1.3rem;
        }

        .infom {
            width: 100%;
            height: 25%;
            padding: 2% 0;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-top: 1px solid #efefef;
            border-bottom: 1px solid #efefef;
        }

        .main-comment-info {
            padding: 2% 4%;
            width: 100%;
            overflow: hidden;
            padding-bottom: 0;
        }

        .comment-info-details {
            width: 100%;
            border-bottom: 1px solid #cbcbcb;
        }

        .comment-details-top {
            overflow: hidden;
            width: 100%;
            padding: 2%;
            display: flex;
            align-items: center;
        }

        .comment-img {
            max-height: 50px;
            width: 20%;
            max-width: 50px;
            float: left;
        }

            .comment-img img {
                width: 100%;
                border-radius: 50%;
            }

        .comment-head {
            width: 80%;
            float: left;
            display: flex;
            justify-content: space-between;
            align-items: center;
            height: 60px;
        }

        .comment-left {
            padding-left: 7%;
            overflow: hidden;
            width: 59%;
        }

            .comment-left span {
                display: block;
                color: #9a9a9a;
                font-size: 1.3rem;
                width: 100%;
            }

        .comment-right {
            color: #9a9a9a;
            font-size: 1.4rem;
        }

        .comment-details-bottom {
            overflow: hidden;
            width: 100%;
            padding: 2%;
            color: #9a9a9a;
            font-size: 1.4rem;
        }

        #page {
            position: fixed;
            width: 100%;
            height: 100%;
        }

        .main {
            position: fixed;
            width: 100%;
            height: 58.5%;
            top: 41.5%;
        }
        .mengceng{
            position: fixed;
            height: 100%;
            width: 100%;
            top:0;
            background: rgba(0,0,0,0.4);
            z-index: 999;
            display: none;
        }
        .signIn_mc{
            position: absolute;
            top:45%;
            width: 96%;
            background: #f4f5f9;
            border-radius: 8px;
            height:40%;
            left: 2%;
            overflow: hidden;
        }
        .student{
            height:82%;
            width: 100%;
            overflow-y: auto;
        }
        .operate{
            height:18%;
            width: 100%;
        }
    </style>

</head>
<body>
    <div id="page">
        <div class="head">
            <div class="bg" v-bind:style="{ backgroundImage:'url('+courseInfo.Img+')' }">
                <span class="info" style="font-size: 1.6rem;bottom: 18%;">{{courseInfo.Name}}</span>
                <span class="info" style="font-size: 1.3rem">报名：{{courseInfo.aStartTime}} 至 {{courseInfo.aEndTime}}</span>
            </div>
            <header data-am-widget="header" class="am-header am-header-default" style="background-color:rgba(0,0,0,0);position: absolute;top: 0;">
                <div class="am-header-left am-header-nav">
                    <a href=" " class="">
                        <img class="am-header-icon-custom" src="images/toleft.png" alt="" />
                    </a>
                </div>
                <div class="am-header-right am-header-nav" style="width: 49px;height: 49px;display: flex;justify-content: center;align-items: center">
                    <a href="" style="width: 100%;height: 100%;justify-content: center;align-items: center;display: flex;">
                        <span class="am-icon am-icon-phone"
                              style="display: flex;justify-content: center;
                      align-items: center;height: 35px;width: 35px;
                      color: #fff;border: 1px solid #fff;border-radius: 50%"></span>
                    </a>
                </div>
            </header>
            <div class="name-info">
                <span class="name-info-main">{{courseInfo.Name}}</span>
                <div class="game_maind1">
                    <div><img src="images/personticket01.png" alt="" style="width: 7%;float: left;display: block; margin-top: 4%;margin-right: 1%"><span style="color: #606060;font-size: 1.4rem">{{courseInfo.OrganizeName}}</span></div>
                    <div>
                        <img src="images/signin02.png" alt="" style="width: 34%;float: left;display: block; margin-top: 19%;margin-right:10%">
                        <span style="color: #505050;font-size: 1.4rem">{{trainsign.length}}</span>
                    </div>
                </div>
            </div>
        </div>
        <div class="main">
            <div class="am-tabs" data-am-tabs="{noSwipe: 1}" id="doc-tab-demo-1" style="position: relative;width: 100%;height: 100%;">
                <ul class="am-tabs-nav am-nav am-nav-tabs" style="background: #fff;position: absolute;width: 100%;height: 13.5%;">
                    <li class="am-active am-u-sm-4"><a href="" style="color: #8f8f8f;text-align: center;">学员签到</a></li>
                    <li class=" am-u-sm-4"><a href="" style="color: #8f8f8f;text-align: center;">学员管理</a></li>
                    <li class=" am-u-sm-4"><a href="" style="color: #8f8f8f;text-align: center;">课程动态</a></li>
                </ul>

                <div class="am-tabs-bd" style="position: absolute;height: 86.5%;width: 100%;top: 13.5%;">
                    <div style="height: 100%;background: #f4f5f9" class="am-tab-panel am-active">
                        <div class="am-u-sm-12" style="padding: 0;background: #f4f5f9;height: 100%;overflow-y: auto">
                            <div class="courseplaninfo">
                                <div v-for="(trainInfo,index) in trainInfoList" class="courseplanbody activing">
                                    <div class="coursedateimg">
                                        <span class="am-icon am-icon-calendar-minus-o" style="background: #54dea7"></span>
                                    </div>
                                    <div class="coursedateinfo">
                                        <span class="coursedateinfo_sp1">{{trainInfo.date}}</span>
                                        <span class="coursedateinfo_sp2"><span class="am-icon am-icon-clock-o" style="margin-right: 5%"></span>{{trainInfo.actvitytime}}</span>
                                    </div>
                                    <div class="">
                                        <button class="am-btn am-radius" v-on:click="chickQD(index)" style="color: #fff;font-size: 1.3rem;background: #54dea7;">{{trainInfo.state}}</button>
                                    </div>
                                </div>
                                <div v-for="trainInfo in trainInfo2List" class="courseplanbody">
                                    <div class="coursedateimg">
                                        <span class="am-icon am-icon-calendar-minus-o"></span>
                                    </div>
                                    <div class="coursedateinfo">
                                        <span class="coursedateinfo_sp1">{{trainInfo.date}}</span>
                                        <span class="coursedateinfo_sp2"><span class="am-icon am-icon-clock-o" style="margin-right: 5%"></span>{{trainInfo.actvitytime}}</span>
                                    </div>
                                    <div class="">
                                        <button class="am-btn am-radius" style="color: #fff;font-size: 1.3rem;">{{trainInfo.state}}</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="am-tab-panel" style="height: 100%;background: #fff">
                        <div style="width: 100%;overflow-y:auto;height: 88%;padding: 2%">
                            <div v-for="(trainsignItem,index) in trainsign" class="infom">
                                <div style="max-width: 35px;height: 35px;max-height: 30px;">
                                    <img v-bind:src="trainsignItem.headImg" alt="" style="width: 100%;border-radius: 50%">
                                </div>
                                <span style="margin-left: -60%;">{{trainsignItem.UsergName}}</span>
                                <!--<div class="choseThis" data-index="index" style="max-width: 25px;height: 25px;max-height:25px;">
                                    <img v-if="trainsignItem.choseThis==0" src="images/discount_01.png" alt="" style="width: 100%;border-radius: 50%">
                                    <img v-else src="images/discount_02.png" alt="" style="width: 100%;border-radius: 50%">
                                </div>-->
                            </div>
                        </div>
                        <!--<div class="fixed">
                            <div class="price">
                                <div v-on:click="allclose()" style="max-height: 15px;max-width: 15px;margin-left: -10%;margin-right: 5%;">
                                    <img v-if="allchose==0" src="images/discount_01.png" alt="" style="width: 100%;border-radius: 50%;display: block;">
                                    <img v-else src="images/discount_02.png" alt="" style="width: 100%;border-radius: 50%;display: block;">
                                </div>
                                <span style="margin-right: 5%">全选</span>
                                <span style="margin-right: -10%;">合计：{{trainsign.length}}人</span>
                            </div>
                            <div class="active_btn" v-on:click="quedingqiandao()">确定</div>
                        </div>-->
                        <!--<span class="am-icon am-icon-check-circle"></span>-->
                    </div>
                    <div class="am-tab-panel" style="height: 100%;background: #fff">
                        <div class="main-comment-info" style="overflow-y: auto;height: 88%;">
                            <div v-for="dynamic in dynamicInfo" class="comment-info-details">
                                <div class="comment-details-top">
                                    <div class="comment-img">
                                        <img v-bind:src="dynamic.headimg" alt="">
                                    </div>
                                    <div class="comment-head" style="width: 80%">
                                        <div class="comment-left" style="    width: 70%;">
                                            <span style="color: #000;font-size: 1.6rem;display: inline-block;width:50%;float: left">{{dynamic.name}}</span>
                                            <span class="am-badge am-radius" style="width:50%;display: inline-block;border: 1px solid #fc8b5d;color: #fc8b5d;background: inherit;font-weight: 100;border-radius: 5px;font-size: 1.5rem">{{dynamic.coach}}</span>
                                        </div>
                                    </div>
                                </div>
                                <div class="comment-details-bottom">
                                    <span>{{dynamic.cont}}</span>
                                    <span style="font-size: 1.2rem;display: block;">{{dynamic.date}}</span>
                                </div>
                            </div>
                        </div>
                        <div class="fixed" style="background: #54dea7;color: #fff;width: 100%;height: 12%;display: flex;justify-content: center;align-items: center" v-on:click="tianjia()">
                            添加动态
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="mengceng">
            <div class="signIn_mc">
                <div class="student">
                    <div v-for="(infom,index) in trainsignInfo" v-on:click="choseThisFunc(index)" style="padding: 5%" class="infom">
                        <div style="max-width: 35px;height: 35px;max-height: 35px;">
                            <img v-bind:src="infom.headImg" alt="" style="width: 100%;border-radius: 50%">
                        </div>
                        <span style="margin-left: -60%;font-size: 1.3rem">{{infom.UsergName}}</span>
                        <div class="choseThis" data-index="index" style="max-width: 20px;height: 20px;max-height:20px;">
                            <img v-if="infom.choseThis==0" src="images/discount_01.png" alt="" style="width: 100%;border-radius: 50%">
                            <img v-else src="images/discount_02.png" alt="" style="width: 100%;border-radius: 50%">
                        </div>
                    </div>
                </div>
                <div class="operate">
                    <div class="active_btn" v-on:click="quxiaobm()">取消</div>
                    <div class="price">
                        <div v-on:click="allclose()" style="max-height: 15px;max-width: 15px;margin-left: -10%;margin-right: 5%;">
                            <img v-if="allchose==0" src="images/discount_01.png" alt="" style="width: 100%;border-radius: 50%;display: block;">
                            <img v-else src="images/discount_02.png" alt="" style="width: 100%;border-radius: 50%;display: block;">
                        </div>
                        <span style="margin-right: 5%">全选</span>
                        <span style="margin-right: -10%;">合计：{{trainsignInfo.length}}人</span>
                    </div>
                   
                    <div class="active_btn activebtn_mc" v-on:click="quedingqiandao()">确定</div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>

<script src="https://cdn.bootcss.com/jquery/1.8.3/jquery.js"></script>
<script src="js/common.js"></script>
<script src="https://cdn.bootcss.com/vue/2.5.9/vue.js"></script>
<script src="http://cdn.amazeui.org/amazeui/2.7.2/js/amazeui.min.js"></script>
<script>
    var page = new Vue({
        el: "#page",
        data: {
            tel: 'tel:6846463',
            choseThis: "",
            allchose: 0,
            courseInfo: {},
            dynamicInfo: [],
            trainsign: [],
            trainEvaluate: [],
            trainInfo2List: [],
            trainInfoList: [],
            venueid: "",
            trainsignInfo:[],
        },
        methods: {
            getInfo: function () {
                var that = this;
                $.ajax({
                    type: 'POST',
                    url: window.apiUrl + '/Api/Field/PrivatesignDetails',
                    data: { "gId": that.venueid },
                    success: function (data) {
                        if (data.errcode == 0) {
                            that.courseInfo = data.data.venueInfo;
                            that.dynamicInfo = data.data.trainDynamic;
                            that.trainsign = data.data.trainsign;
                            that.trainInfoList = data.data.trainInfoList;
                            that.trainInfo2List = data.data.trainInfo2List;
                            tel = 'tel:' + that.courseInfo.OrganizePhone;
                            that.trainsignInfo = data.data.trainsign;                            
                        }
                    }
                });
            },
            allclose:function () {
                this.allchose=!this.allchose;
                for (var i = 0; i < page.trainsignInfo.length; i++) {
                    page.trainsignInfo[i].choseThis = this.allchose;
                }
            },
            choseThisFunc: function (index) {
                this.trainsignInfo[index].choseThis = !this.trainsignInfo[index].choseThis;
            },
            chickQD: function (index) {
                var that = this;
                if (that.trainInfoList[index].state == "签到")
                {
                    $.ajax({
                        type: 'POST',
                        url: window.apiUrl + '/Api/Field/getPrivatesignInfo',
                        data: { "PrivateInfogId": that.trainInfoList[index].o.gId },
                        success: function (data) {
                            if (data.errcode == 0) {
                                that.trainsignInfo = data.data.trainsign;
                                that.choseThis = that.trainInfoList[index].o.gId;
                                $('.mengceng').show();
                            }
                        }
                    });
                    //$('.am-tab-panel').eq(1).addClass('am-active am-in').siblings().removeClass('am-active am-in');
                    //$('.am-nav-tabs').children().eq(1).addClass('am-active').siblings().removeClass('am-active')
                }
                //else { alert("未开始"); }
            },
            tianjia: function () {
                location.replace("TrainDynamic.html?gId=" + this.venueid);
            },
            quedingqiandao: function () {
                var that = this;
                if (that.choseThis == "")
                { alert("请选择需要签到的课时"); }
                else {
                    $.ajax({
                        type: 'POST',
                        url: window.apiUrl + '/Api/Field/bPrivateCoach',
                        data: { "gId": that.venueid },
                        success: function (data) {
                            if (data.errcode == 0) {
                                for (var i = 0; i < page.trainsignInfo.length; i++) {
                                    if (page.trainsignInfo[i].choseThis) {
                                        $.ajax({
                                            type: 'POST',
                                            url: window.apiUrl + '/Api/Field/UpdataPrivateSignInfo',
                                            data: { gId: that.trainsignInfo[i].gId, choseThis: that.trainsignInfo[i].choseThis, CoachgId: data.data, Price: data.Price },
                                            success: function (data) {

                                            }
                                        });
                                    }
                                }
                                alert("签到成功");
                            }
                        }
                    });                    
                }
            },
            quxiaobm: function () {
                $('.mengceng').hide();
            }
        }
    })
    $(function () {
        var actid = $.getParam("venueid");
        //alert(actid)
        page.venueid = actid;
        page.getInfo();
    })
</script>

<script>
    $('.activing').click(function () {
        $('.mengceng').show();

    })
    $('.activebtn_mc').click(function () {
        $('.mengceng').hide();
    });
</script>
